//
//  DBTool.h
//  团购
//
//  Created by 樊荣海 on 15/1/22.
//  Copyright (c) 2015年 樊荣海. All rights reserved.
//  测试

#import <Foundation/Foundation.h>
#import "Singleton.h"
#import "FMDB.h"
#import "CityModel.h"
#import "DistrictModel.h"
#import "DropMenuBtn.h"
#import "CateDropBtn.h"
#import "DisDropBtn.h"
#import "OrderDropBtn.h"
#import "DealModel.h"

typedef enum {
    TabelTypeCate  = 0,  //t_Cate
    TabelTypeDis   = 1,  //t_Dis,
    TabelTypeOrder = 2   //t_Order,
} TabelType;

@interface DBTool : NSObject

singleton_interface(DBTool)

//插入城市
- (void)insertCityModel:(CityModel *)cityModel;

//查询最近的4个城市
- (NSMutableArray *)selectAllCityModel;

//查询最近的1个城市
- (NSString *)selectCurrentCity;

//=================================================================

//插入类别
- (void)insertSubTitle:(NSString *)cate btn:(DropMenuBtn *)sender;

//查询最近的1个分类-subTitle
- (NSString *)selectSuperTitle:(TabelType)tableType;


//查询最近的1个分类-superTitle
- (NSString *)selectSubTitle:(TabelType)tableType;

//删除所有选择分类
- (void)deleteAllSubAndSuperTitle;

//=================================================================

//根据deal_ID查询dealModel是否存在于数据库
- (BOOL)dealIsExist:(DealModel *)dealModel;

//插入一个dealModel
- (void)insertDealModel:(DealModel *)dealModel;

//删掉一个dealModel
- (void)deleteDealModel:(DealModel *)dealModel;




@end



















